#ifndef _SELECT_SVR_H_
#define _SELECT_SVR_H_

#include <iostream>
#include <sys/select.h>
#include "Sock.hpp"

using namespace std;

class SelectServer
{
public:
    SelectServer(const uint16_t& port = 8080)
        : _port(port)
    {
        listensock = Sock::Socket();
        Sock::Bind(listensock, _port);
        Sock::Listen(listensock);
        logMessage(DEBUG, "create base socket success");
    }
    void Start()
    {
        while (true)
        {
            // 
        }
    }

    ~SelectServer()
    {
        if (listensock >= 0) close(listensock);
    }
private:
    uint16_t _port;
    int listensock;
};

#endif 